home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 13
/
013.d81
/
label maker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
3KB
|
87 lines
1 gosub500
10 diml$(5),e%(5):dv=4
15 printtchr$(9)chr$(142)chr$(8)"[147][144]align print head as shown"
20 print"[144] [223][157][157] [146] [157][157][157] [146][212][157][212][145][156][192][192] label [144]side[157][157][157][157]view"
25 print"[156] [221][157][202][192] print head"
30 print"[144] [210][210][210][157][157][157][157][157][169][188][190][223][157][157][157] "
35 print"[156][145][145][145][201][157][202][192] label"
37 print" [202][192] print head [145][145][144]top [157][157][157][157]view"
40 print" push any key ":gosub330
45 rem *** upper/lower case ***
50 print"[147]upper & lower case?"
55 gosub330:ifa$="y"thenc$=chr$(17):printchr$(9)chr$(14):goto65
60 c$=chr$(15):printchr$(142)
65 fori=1to5:l$(i)="":e%(i)=0:nexti
70 rem *** input label ***
75 fori=1to5
80 print"[147][144]you have a maximum of 5[146] rows with 33[146]"
82 print"charactors per row.":print"if the 1st character";
85 print" is '^' then the row will be double width."
90 print"line #"i
95 print" ";chr$(34);chr$(34);chr$(20);:ife%(i)thenprint"^";
100 printl$(i):print""
105 inputl$(i)
110 ifleft$(l$(i),1)="^"thene%(i)=1:l$(i)=right$(l$(i),len(l$(i))-1):goto125
112 ifleft$(l$(i),1)="^"thengoto120
115 e%(i)=0
120 iflen(l$(i))>33-e%(i)*16then80
125 nexti
130 rem *** center vertically ***
135 print"centered vertically?":gosub330:ifa$<>"y"then185
140 k=0:fori=1to5:ifl$(i)<>""theni=5:goto150
145 k=k+1
150 nexti
155 kk=0:fori=1to5:ifl$(6-i)<>""theni=5:goto165
160 kk=kk+1
165 nexti
170 ifk+1<kkthenfori=1tokk-k-2:forj=5to2step-1
172 ifk+1<kkthenl$(j)=l$(j-1):e%(j)=e%(j-1):nextj:l$(1)="":nexti
175 ifk>kkthenfori=1tok-kk-1:forj=1to4:l$(j)=l$(j+1)
177 ifk>kkthene%(j)=e%(j+1):nextj:l$(5)="":nexti
180 rem *** check label ***
185 print"[147]label check"
190 print"if the line is reversed, then it is double width letters."
195 fori=1to5:ife%(i)thenprint"[144]"i"[156]"l$(i):goto205
200 print"[144]"i"[146][156]"l$(i)
205 nexti
210 print"[144] is this label ok?"
215 gosub330:ifa$<>"y"then75
220 print"[147]how many would you like to print ":inputa$:n=val(a$):ifn<1then185
225 print"c[146]entered or l[146]eft justified?"
230 gosub330:ifa$="l"thench$="l":goto250
235 ifa$="c"thench$="c":goto265
240 goto230
245 rem *** left justify ***
250 k=1:fori=2to5:iflen(l$(i))>len(l$(k))thenk=i
255 nexti:a$="":fori=1toint((33-e%(k)*16-len(l$(k)))/2):a$=a$+" ":nexti
260 rem *** sent to printer ***
265 open4,4:if c$=chr$(17)then close4:open4,4,7
270 fork=1ton:print"lbl"k
275 getz$:ifz$=""then295
280 ifz$="q"thenclose4:goto180
285 print"push any key"
290 getz$:ifz$=""then290
291 ifz$="q"then280
292 print" "
295 fori=1to5:print#dv,c$;:x$="":ife%(i)thenx$=chr$(14)
300 ifch$="l"thenprint#dv,c$+a$+x$+l$(i)+chr$(15):goto310
305 a$="":forj=1toint((33-e%(i)*16-len(l$(i)))/2)
307 a$=a$+" ":nextj:print#dv,c$+x$+a$+l$(i)+chr$(15)
310 nexti:print#dv,chr$(15)
315 nextk:close4
320 print"do you want to do some more labels?":gosub330:ifa$="y"then185
325 goto63000
330 geta$:ifa$=""then330
335 return
500 print"[147] do you have a printer?"
502 poke198,0:wait198,1:geta$:ifa$<>"y"anda$<>"n"thenpoke53280,rnd(1)*15:goto502
504 ifa$="y"thenreturn
506 :
510 print"[147]sorry...this program requires a printer."
520 fordl=1to2000:next:goto63100
530 :
63000 rem connect back to l.s.
63010 :
63100 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
63102 poke631,13:poke632,13:poke198,2:end